const mongoose = require("mongoose");

const bookSchema = new mongoose.Schema(
  {
    name: { // 书名
      type: String,
      required: true,
    },
    author: {  // 作者
      type: String,
      required: true,
    },
    press: {  // 出版社
      type: String,
    },
    price: {  // 价格
      type: Number,
    },
  },
  {
    timestamps: true,
  }
);

module.exports = mongoose.model("Book", bookSchema);
